<?php

/**
 * Application Models
 *
 * @package Application_Model
 * @subpackage Model
 * @author <YOUR NAME HERE>
 * @copyright ZF model generator
 * @license http://framework.zend.com/license/new-bsd     New BSD License
 */

/**
 * Abstract class for models
 */
require_once 'ModelAbstract.php';

/**
 * 
 *
 * @package Application_Model
 * @subpackage Model
 * @author <YOUR NAME HERE>
 */
class Application_Model_PilotDefcolumn extends Application_Model_ModelAbstract
{

    /**
     * Database var type int(11)
     *
     * @var int
     */
    protected $_IdPILOTDEFCOLUMN;

    /**
     * Database var type varchar(255)
     *
     * @var string
     */
    protected $_IdPILOTLISTCOLUMN;

    /**
     * Database var type int(11)
     *
     * @var int
     */
    protected $_PILOTREQUESTIdPILOTREQUEST;

    /**
     * Database var type varchar(10)
     *
     * @var string
     */
    protected $_ISCHART;

    /**
     * Database var type varchar(45)
     *
     * @var string
     */
    protected $_CHARTAXE;

    /**
     * Database var type varchar(45)
     *
     * @var string
     */
    protected $_AXENOM;

    /**
     * Database var type varchar(255)
     *
     * @var string
     */
    protected $_PILOTAXESIdPILOTAXES;


    /**
     * Parent relation fk_PILOT_DEFCOLUMN_PILOT_LISTCOLUMN10
     *
     * @var Application_Model_PilotListcolumn
     */
    protected $_PilotListcolumn;

    /**
     * Parent relation fk_PILOT_DEFCOLUMN_PILOT_REQUEST10
     *
     * @var Application_Model_PilotRequest
     */
    protected $_PilotRequest;

    /**
     * Parent relation fk_PILOT_DEFCOLUMN_PILOT_AXES1
     *
     * @var Application_Model_PilotAxes
     */
    protected $_PilotAxes;


    /**
     * Sets up column and relationship lists
     */
    public function __construct()
    {
        parent::init();
        $this->setColumnsList(array(
            'idPILOT_DEFCOLUMN'=>'IdPILOTDEFCOLUMN',
            'idPILOT_LISTCOLUMN'=>'IdPILOTLISTCOLUMN',
            'PILOT_REQUEST_idPILOT_REQUEST'=>'PILOTREQUESTIdPILOTREQUEST',
            'ISCHART'=>'ISCHART',
            'CHART_AXE'=>'CHARTAXE',
            'AXENOM'=>'AXENOM',
            'PILOT_AXES_idPILOT_AXES'=>'PILOTAXESIdPILOTAXES',
        ));

        $this->setParentList(array(
            'FkPILOTDEFCOLUMNPILOTLISTCOLUMN10'=> array(
                    'property' => 'PilotListcolumn',
                    'table_name' => 'PilotListcolumn',
                ),
            'FkPILOTDEFCOLUMNPILOTREQUEST10'=> array(
                    'property' => 'PilotRequest',
                    'table_name' => 'PilotRequest',
                ),
            'FkPILOTDEFCOLUMNPILOTAXES1'=> array(
                    'property' => 'PilotAxes',
                    'table_name' => 'PilotAxes',
                ),
        ));

        $this->setDependentList(array(
        ));
    }

    /**
     * Sets column idPILOT_DEFCOLUMN
     *
     * @param int $data
     * @return Application_Model_PilotDefcolumn
     */
    public function setIdPILOTDEFCOLUMN($data)
    {
        $this->_IdPILOTDEFCOLUMN = $data;
        return $this;
    }

    /**
     * Gets column idPILOT_DEFCOLUMN
     *
     * @return int
     */
    public function getIdPILOTDEFCOLUMN()
    {
        return $this->_IdPILOTDEFCOLUMN;
    }

    /**
     * Sets column idPILOT_LISTCOLUMN
     *
     * @param string $data
     * @return Application_Model_PilotDefcolumn
     */
    public function setIdPILOTLISTCOLUMN($data)
    {
        $this->_IdPILOTLISTCOLUMN = $data;
        return $this;
    }

    /**
     * Gets column idPILOT_LISTCOLUMN
     *
     * @return string
     */
    public function getIdPILOTLISTCOLUMN()
    {
        return $this->_IdPILOTLISTCOLUMN;
    }

    /**
     * Sets column PILOT_REQUEST_idPILOT_REQUEST
     *
     * @param int $data
     * @return Application_Model_PilotDefcolumn
     */
    public function setPILOTREQUESTIdPILOTREQUEST($data)
    {
        $this->_PILOTREQUESTIdPILOTREQUEST = $data;
        return $this;
    }

    /**
     * Gets column PILOT_REQUEST_idPILOT_REQUEST
     *
     * @return int
     */
    public function getPILOTREQUESTIdPILOTREQUEST()
    {
        return $this->_PILOTREQUESTIdPILOTREQUEST;
    }

    /**
     * Sets column ISCHART
     *
     * @param string $data
     * @return Application_Model_PilotDefcolumn
     */
    public function setISCHART($data)
    {
        $this->_ISCHART = $data;
        return $this;
    }

    /**
     * Gets column ISCHART
     *
     * @return string
     */
    public function getISCHART()
    {
        return $this->_ISCHART;
    }

    /**
     * Sets column CHART_AXE
     *
     * @param string $data
     * @return Application_Model_PilotDefcolumn
     */
    public function setCHARTAXE($data)
    {
        $this->_CHARTAXE = $data;
        return $this;
    }

    /**
     * Gets column CHART_AXE
     *
     * @return string
     */
    public function getCHARTAXE()
    {
        return $this->_CHARTAXE;
    }

    /**
     * Sets column AXENOM
     *
     * @param string $data
     * @return Application_Model_PilotDefcolumn
     */
    public function setAXENOM($data)
    {
        $this->_AXENOM = $data;
        return $this;
    }

    /**
     * Gets column AXENOM
     *
     * @return string
     */
    public function getAXENOM()
    {
        return $this->_AXENOM;
    }

    /**
     * Sets column PILOT_AXES_idPILOT_AXES
     *
     * @param string $data
     * @return Application_Model_PilotDefcolumn
     */
    public function setPILOTAXESIdPILOTAXES($data)
    {
        $this->_PILOTAXESIdPILOTAXES = $data;
        return $this;
    }

    /**
     * Gets column PILOT_AXES_idPILOT_AXES
     *
     * @return string
     */
    public function getPILOTAXESIdPILOTAXES()
    {
        return $this->_PILOTAXESIdPILOTAXES;
    }

    /**
     * Sets parent relation IdPILOTLISTCOLUMN
     *
     * @param Application_Model_PilotListcolumn $data
     * @return Application_Model_PilotDefcolumn
     */
    public function setPilotListcolumn(Application_Model_PilotListcolumn $data)
    {
        $this->_PilotListcolumn = $data;

        $primary_key = $data->getPrimaryKey();
        if (is_array($primary_key)) {
            $primary_key = $primary_key['idPILOT_LISTCOLUMN'];
        }

        $this->setIdPILOTLISTCOLUMN($primary_key);

        return $this;
    }

    /**
     * Gets parent IdPILOTLISTCOLUMN
     *
     * @param boolean $load Load the object if it is not already
     * @return Application_Model_PilotListcolumn
     */
    public function getPilotListcolumn($load = true)
    {
        if ($this->_PilotListcolumn === null && $load) {
            $this->getMapper()->loadRelated('FkPILOTDEFCOLUMNPILOTLISTCOLUMN10', $this);
        }

        return $this->_PilotListcolumn;
    }

    /**
     * Sets parent relation PILOTREQUESTIdPILOTREQUEST
     *
     * @param Application_Model_PilotRequest $data
     * @return Application_Model_PilotDefcolumn
     */
    public function setPilotRequest(Application_Model_PilotRequest $data)
    {
        $this->_PilotRequest = $data;

        $primary_key = $data->getPrimaryKey();
        if (is_array($primary_key)) {
            $primary_key = $primary_key['idPILOT_REQUEST'];
        }

        $this->setPILOTREQUESTIdPILOTREQUEST($primary_key);

        return $this;
    }

    /**
     * Gets parent PILOTREQUESTIdPILOTREQUEST
     *
     * @param boolean $load Load the object if it is not already
     * @return Application_Model_PilotRequest
     */
    public function getPilotRequest($load = true)
    {
        if ($this->_PilotRequest === null && $load) {
            $this->getMapper()->loadRelated('FkPILOTDEFCOLUMNPILOTREQUEST10', $this);
        }

        return $this->_PilotRequest;
    }

    /**
     * Sets parent relation PILOTAXESIdPILOTAXES
     *
     * @param Application_Model_PilotAxes $data
     * @return Application_Model_PilotDefcolumn
     */
    public function setPilotAxes(Application_Model_PilotAxes $data)
    {
        $this->_PilotAxes = $data;

        $primary_key = $data->getPrimaryKey();
        if (is_array($primary_key)) {
            $primary_key = $primary_key['idPILOT_AXES'];
        }

        $this->setPILOTAXESIdPILOTAXES($primary_key);

        return $this;
    }

    /**
     * Gets parent PILOTAXESIdPILOTAXES
     *
     * @param boolean $load Load the object if it is not already
     * @return Application_Model_PilotAxes
     */
    public function getPilotAxes($load = true)
    {
        if ($this->_PilotAxes === null && $load) {
            $this->getMapper()->loadRelated('FkPILOTDEFCOLUMNPILOTAXES1', $this);
        }

        return $this->_PilotAxes;
    }

    /**
     * Returns the mapper class for this model
     *
     * @return Application_Model_Mapper_PilotDefcolumn
     */
    public function getMapper()
    {
        if ($this->_mapper === null) {
            $this->setMapper(new Application_Model_Mapper_PilotDefcolumn());
        }

        return $this->_mapper;
    }

    /**
     * Deletes current row by deleting the row that matches the primary key
     *
	 * @see Application_Model_Mapper_PilotDefcolumn::delete
     * @return int|boolean Number of rows deleted or boolean if doing soft delete
     */
    public function deleteRowByPrimaryKey()
    {
        if ($this->getIdPILOTDEFCOLUMN() === null) {
            throw new Exception('Primary Key does not contain a value');
        }

        return $this->getMapper()
                    ->getDbTable()
                    ->delete('idPILOT_DEFCOLUMN = ' .
                             $this->getMapper()
                                  ->getDbTable()
                                  ->getAdapter()
                                  ->quote($this->getIdPILOTDEFCOLUMN()));
    }
}
